//
//  AKPMessagesListTableViewController.m
//  Copy_AiKapPu_Personal_OC
//
//  Created by taojianz on 2017/7/13.
//  Copyright © 2017年 taojianz. All rights reserved.
//

#import "AKPMessagesListTableViewController.h"
#import "AKPMessageListTableViewCell.h"
#import "UIColor+CZAddition.h"
#import <nbappdev/nbappdev.h>
#import "AKPMessageDetailTableViewController.h"

@interface AKPMessagesListTableViewController ()

@end

@implementation AKPMessagesListTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"系统消息";
    [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
    
    [self.tableView registerClass:[AKPMessageListTableViewCell class] forCellReuseIdentifier:@"AKPMessagesListTableViewCell"];
    self.tableView.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    AKPMessageListTableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 2;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    AKPMessageListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AKPMessagesListTableViewCell" forIndexPath:indexPath];
    
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 115;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:true];
    
    AKPMessageDetailTableViewController *vc = [Helper getViewController:@"AKPMessageDetailTableViewController" withStoryboard:@"AKPMessage"];
    
    vc.infoDict = @{@"title":@"系统消息",@"content":@"儿子中考考试考差了，被老婆骂了一顿。我去安慰儿子：“你要努力学习，以后一定要超越爸爸。”儿子愣了一下，弱弱来了一句：“别的我不敢保证。但是，以后找个比你好的老婆还是很有把握的。”‍‍‍‍"};
    
    [self.navigationController pushViewController:vc animated:true];
}

//-tableview

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
